Ext.define('PJ.view.messagemanagement.DepartmentTree', {
    extend: 'AM.default.DefaultTree',
    alias: ['widget.deptTree'],
    
    initComponent: function(){
    	this.store = Ext.create('PJ.'+ prototype +'.messagemanagement.DepartmentTree');
    	var newParams = {
    		//默认西城区为根节点
			searchProjectID:'1854369',
    		searchFrameType:1
        };
        // 4.0强制更改store参数写法
        var params = this.store.proxy.extraParams;
        Ext.apply(params, newParams);
        this.store.isLoad = true;
        this.callParent(arguments);
    },
	listeners: {
		//显示树的一级菜单
        load: function(treeStore, node, records, successful, eOpts){
            if (records != null && node.hasChildNodes()) {
                this.expandNode(records[0]);
                isExp = false;
            }
        },
		itemClick: function(){
			var me=this;
			var store =  me.up("container").down("messagemanagementPreChoisedList").getStore();
			var record=me.getSelectionModel().getSelection();
	        var newParams = {
	            deptId: record[0].data.id,
	            noUserIDs:me.receiveUserIds.getValue()
	        };
	        // 4.0强制更改store参数写法
	        var params = store.proxy.extraParams;
	        Ext.apply(params, newParams);
	        // grid加载生效
	        store.isLoad = true;
	        store.load();
		}
	}
});
